<%-- 
    Document   : cart
    Created on : Aug 3, 2012, 10:22:46 PM
    Author     : Atienza-Home
--%>

<%@include file="include/accountsession.jsp" %>

<%@page import="java.util.Iterator"%>
<%@page import="Factory.Tables.Movie"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
   
    ArrayList<Movie> result = (ArrayList<Movie>)session.getAttribute("top50movies");
    Iterator<Movie> iter;
    Movie movie;
    int i=0;
            
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>My Cart</title>

<link href="header.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquerymenubar.js"></script>
<script type="text/javascript" src="ajaxmain.js"></script>
<script type="text/javascript" src="jquery.tablesorter.js"></script>

<script type="text/javascript">
$(document).ready(function() {  
   // call the tablesorter plugin 
    $("table").tablesorter({ 
        // sort on the first column and third column, order asc 
        sortList: [[0,0],[2,0]] 
    }); 
} 
</script>


</head>
<body onload="retrieveCart('<%=user.getUserID()%>');retrieveTop50Movies()">

<div id="header" >

    <%@include file="include/header.jsp" %>

</div>
<div class="menu">  
    
    <%@include file="include/menubar.jsp" %>
    
</div>

<!-- end of HEADER -->

<!-- BODY -->
<div style="background-color:#009999; border:15px solid #cccccc; width:960px;">
    <marquee>
        <font color="black">
        Top 10 movies by rating:
        <%
        if(result!=null){
            iter = result.iterator(); 
            while(iter.hasNext() && i<10){
                movie = iter.next();
        %>
            <%=i+1%>.) <a href="movie.jsp?id=<%=movie.getId()%>"><font color="white"><%=movie.getName()%></font></a>&nbsp;
        <%
            i++;
            }
        }
        %>
        
        </font>
    </marquee>
</div>
<div id="realbody" style="background-color:#009999; border:15px solid #006666; padding:20px;width:920px;">
    
    <div id="cartpane">
        asdasd
        asdasdasd<br>asdasd
    </div>    
 </div>

</body>
</html>
